package tcu.ead.leety.tcuplant.common;

import lombok.Data;

import java.io.Serializable;


@Data
public class R implements Serializable {
    /*
    JSON格式返回格式统一封装
    code：成功200，失败401
    success："true"，"false"
    message："成功"，"失败"
    data：object格式，可传入任意数据
    * */
    private String type;
    private String version;
    private int id;
    private int tid;
    private String card;
    private String name;

    public static R ok(String type, String version, int id, int tid,String card,String name) {
        R result = new R();
        result.setType(type);
        result.setVersion(version);
        result.setId(id);
        result.setTid(tid);
        result.setName(name);
        result.setCard(card);

        return result;
    }

}
